package com.cskaoyan.interceptor;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.stereotype.Component;

/**
 * 通知
 * @author stone
 * @date 2021/12/27 17:37
 */
@Component
public class CustomInterceptor implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("正道的光2.0");
        Object proceed = methodInvocation.proceed();//执行的是委托类的方法，类似于method.invoke
        System.out.println("照在大地上2.0");
        return proceed;
    }
}
